package com.fingard.dsp.bank.reqrespobj.billpool;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RequestBase;
import com.fingard.dsp.bank.reqrespobj.billpool.Detail.ReqB317OnlineFinancingApplyDetail;
import com.fingard.xml.XmlTextReader;

public class ReqB317OnlineFinancingApply extends RequestBase {
    public ReqB317OnlineFinancingApplyDetail reqDetail = null;
    //融资用途
    public String finPurpose;
    //申请说明
    public String applyDesc;
    //出票融资申请人账号
    public String drawAcctid;
    //出票人信用评级
    public String crdlvl;
    //出票人评级主体
    public String rtgagncy;
    //出票人评级到期日
    public String rtgduedate;
    //票据总笔数
    public String totalCount;
    //票据总金额
    public String totalAmt;
    //商票交易类型
    public String type;
    //是否确认合同
    public String confirm;
    //请求流水号
    public String clientRef;
    //业务品种代码
    public String bizcode;

    private XmlTextReader xmlReader;


    public boolean readRecord() throws Exception {
        reqDetail = null;
        if (xmlReader.read(PATH_Detail)) {
            reqDetail = new ReqB317OnlineFinancingApplyDetail(xmlReader.readedXElement);
            return true;
        } else {
            return false;
        }
    }

    public ReqB317OnlineFinancingApply(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception {
        reqHeader = p_header;
        xmlReader = p_xmlReader;

        finPurpose = xmlReader.getSimpleText("FinPurpose");
        applyDesc = xmlReader.getSimpleText("ApplyDesc");
        drawAcctid = xmlReader.getSimpleText("DrawAcctid");
        crdlvl = xmlReader.getSimpleText("Crdlvl");
        rtgagncy = xmlReader.getSimpleText("Rtgagncy");
        rtgduedate = xmlReader.getSimpleText("Rtgduedate");
        totalCount = xmlReader.getSimpleText("TotalCount");
        totalAmt = xmlReader.getSimpleText("TotalAmt");
        type = xmlReader.getSimpleText("Type");
        confirm = xmlReader.getSimpleText("Confirm");
        clientRef = xmlReader.getSimpleText("ClientRef");
        bizcode = xmlReader.getSimpleText("Bizcode");
    }
}
